from app import db
from .base_model import BaseModel


class Tag(BaseModel):
    '''标签'''
    __tablename__ = 'tag'
    __table_args__ = ({'comment': '文章标签表'})
    id = db.Column(db.Integer, primary_key=True, comment="标签ID")
    name = db.Column(db.String(255), nullable=False, unique=True, comment="标签名称")

    def __repr__(self) -> str:
        return "<Tag %s>" % self.to_json()
